#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;

int n, ans;
int b[N], lst;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);

	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);

	cin >> n;
	int x;
	for(int i = 1; i <= n; i++){
        cin >> x;
        b[x]++;
	}
	ans = n;

	for(int i = 1; i < N - 3; i++){
        if(b[i]){
            if(b[i] >= lst){
                ans -= lst;
                lst = b[i];
            }
            else{
                ans -= b[i];
            }
        }
	}

	cout << ans;

	return 0;
}
